Optimal. Leaf size=94 \[ \frac {a}{e \left (f+\frac {e}{x}\right )}-\frac {b d \cos \left (c-\frac {d f}{e}\right ) \text {Ci}\left (d \left (\frac {f}{e}+\frac {1}{x}\right )\right )}{e^2}+\frac {b \sin \left (c+\frac {d}{x}\right )}{e \left (f+\frac {e}{x}\right )}+\frac {b d \sin \left (c-\frac {d f}{e}\right ) \text {Si}\left (d \left (\frac {f}{e}+\frac {1}{x}\right )\right )}{e^2} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.13, antiderivative size = 94, normalized size of antiderivative = 1.00, number of steps
used = 7, number of rules used = 6, integrand size = 20, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.300, Rules used = {3512, 3398,
3378, 3384, 3380, 3383} \begin {gather*} \frac {a}{e \left (\frac {e}{x}+f\right )}-\frac {b d \cos \left (c-\frac {d f}{e}\right ) \text {CosIntegral}\left (d \left (\frac {f}{e}+\frac {1}{x}\right )\right )}{e^2}+\frac {b d \sin \left (c-\frac {d f}{e}\right ) \text {Si}\left (d \left (\frac {f}{e}+\frac {1}{x}\right )\right )}{e^2}+\frac {b \sin \left (c+\frac {d}{x}\right )}{e \left (\frac {e}{x}+f\right )} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 3378
Rule 3380
Rule 3383
Rule 3384
Rule 3398
Rule 3512
Rubi steps
\begin {align*} \int \frac {a+b \sin \left (c+\frac {d}{x}\right )}{(e+f x)^2} \, dx &=-\text {Subst}\left (\int \frac {a+b \sin (c+d x)}{(f+e x)^2} \, dx,x,\frac {1}{x}\right )\\ &=-\text {Subst}\left (\int \left (\frac {a}{(f+e x)^2}+\frac {b \sin (c+d x)}{(f+e x)^2}\right ) \, dx,x,\frac {1}{x}\right )\\ &=\frac {a}{e \left (f+\frac {e}{x}\right )}-b \text {Subst}\left (\int \frac {\sin (c+d x)}{(f+e x)^2} \, dx,x,\frac {1}{x}\right )\\ &=\frac {a}{e \left (f+\frac {e}{x}\right )}+\frac {b \sin \left (c+\frac {d}{x}\right )}{e \left (f+\frac {e}{x}\right )}-\frac {(b d) \text {Subst}\left (\int \frac {\cos (c+d x)}{f+e x} \, dx,x,\frac {1}{x}\right )}{e}\\ &=\frac {a}{e \left (f+\frac {e}{x}\right )}+\frac {b \sin \left (c+\frac {d}{x}\right )}{e \left (f+\frac {e}{x}\right )}-\frac {\left (b d \cos \left (c-\frac {d f}{e}\right )\right ) \text {Subst}\left (\int \frac {\cos \left (\frac {d f}{e}+d x\right )}{f+e x} \, dx,x,\frac {1}{x}\right )}{e}+\frac {\left (b d \sin \left (c-\frac {d f}{e}\right )\right ) \text {Subst}\left (\int \frac {\sin \left (\frac {d f}{e}+d x\right )}{f+e x} \, dx,x,\frac {1}{x}\right )}{e}\\ &=\frac {a}{e \left (f+\frac {e}{x}\right )}-\frac {b d \cos \left (c-\frac {d f}{e}\right ) \text {Ci}\left (\frac {d \left (f+\frac {e}{x}\right )}{e}\right )}{e^2}+\frac {b \sin \left (c+\frac {d}{x}\right )}{e \left (f+\frac {e}{x}\right )}+\frac {b d \sin \left (c-\frac {d f}{e}\right ) \text {Si}\left (\frac {d \left (f+\frac {e}{x}\right )}{e}\right )}{e^2}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.48, size = 85, normalized size = 0.90 \begin {gather*} \frac {-b d \cos \left (c-\frac {d f}{e}\right ) \text {Ci}\left (d \left (\frac {f}{e}+\frac {1}{x}\right )\right )+\frac {e \left (-a e+b f x \sin \left (c+\frac {d}{x}\right )\right )}{f (e+f x)}+b d \sin \left (c-\frac {d f}{e}\right ) \text {Si}\left (d \left (\frac {f}{e}+\frac {1}{x}\right )\right )}{e^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.10, size = 149, normalized size = 1.59
method | result | size |
derivativedivides | \(-d \left (-\frac {a}{\left (-c e +d f +e \left (c +\frac {d}{x}\right )\right ) e}+b \left (-\frac {\sin \left (c +\frac {d}{x}\right )}{\left (-c e +d f +e \left (c +\frac {d}{x}\right )\right ) e}+\frac {-\frac {\sinIntegral \left (-\frac {d}{x}-c -\frac {-c e +d f}{e}\right ) \sin \left (\frac {-c e +d f}{e}\right )}{e}+\frac {\cosineIntegral \left (\frac {d}{x}+c +\frac {-c e +d f}{e}\right ) \cos \left (\frac {-c e +d f}{e}\right )}{e}}{e}\right )\right )\) | \(149\) |
default | \(-d \left (-\frac {a}{\left (-c e +d f +e \left (c +\frac {d}{x}\right )\right ) e}+b \left (-\frac {\sin \left (c +\frac {d}{x}\right )}{\left (-c e +d f +e \left (c +\frac {d}{x}\right )\right ) e}+\frac {-\frac {\sinIntegral \left (-\frac {d}{x}-c -\frac {-c e +d f}{e}\right ) \sin \left (\frac {-c e +d f}{e}\right )}{e}+\frac {\cosineIntegral \left (\frac {d}{x}+c +\frac {-c e +d f}{e}\right ) \cos \left (\frac {-c e +d f}{e}\right )}{e}}{e}\right )\right )\) | \(149\) |
risch | \(-\frac {a}{f \left (f x +e \right )}+\frac {b d \,{\mathrm e}^{-\frac {i \left (c e -d f \right )}{e}} \expIntegral \left (1, \frac {i d}{x}+i c -\frac {i \left (c e -d f \right )}{e}\right )}{2 e^{2}}+\frac {b d \,{\mathrm e}^{\frac {i \left (c e -d f \right )}{e}} \expIntegral \left (1, -\frac {i d}{x}-i c -\frac {-i c e +i d f}{e}\right )}{2 e^{2}}+\frac {i b d \sin \left (\frac {c x +d}{x}\right )}{e \left (-i c e +e \left (i c +\frac {i d}{x}\right )+i d f \right )}\) | \(162\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.37, size = 165, normalized size = 1.76 \begin {gather*} \frac {2 \, b f x e \sin \left (\frac {c x + d}{x}\right ) + 2 \, {\left (b d f^{2} x + b d f e\right )} \sin \left (-{\left (d f - c e\right )} e^{\left (-1\right )}\right ) \operatorname {Si}\left (\frac {{\left (d f x + d e\right )} e^{\left (-1\right )}}{x}\right ) - {\left ({\left (b d f^{2} x + b d f e\right )} \operatorname {Ci}\left (\frac {{\left (d f x + d e\right )} e^{\left (-1\right )}}{x}\right ) + {\left (b d f^{2} x + b d f e\right )} \operatorname {Ci}\left (-\frac {{\left (d f x + d e\right )} e^{\left (-1\right )}}{x}\right )\right )} \cos \left (-{\left (d f - c e\right )} e^{\left (-1\right )}\right ) - 2 \, a e^{2}}{2 \, {\left (f^{2} x e^{2} + f e^{3}\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {a + b \sin {\left (c + \frac {d}{x} \right )}}{\left (e + f x\right )^{2}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 347 vs.
\(2 (88) = 176\).
time = 5.63, size = 347, normalized size = 3.69 \begin {gather*} -\frac {b d^{3} f \cos \left (-{\left (d f - c e\right )} e^{\left (-1\right )}\right ) \operatorname {Ci}\left ({\left (d f - c e + \frac {{\left (c x + d\right )} e}{x}\right )} e^{\left (-1\right )}\right ) - b c d^{2} \cos \left (-{\left (d f - c e\right )} e^{\left (-1\right )}\right ) \operatorname {Ci}\left ({\left (d f - c e + \frac {{\left (c x + d\right )} e}{x}\right )} e^{\left (-1\right )}\right ) e + b d^{3} f \sin \left (-{\left (d f - c e\right )} e^{\left (-1\right )}\right ) \operatorname {Si}\left (-{\left (d f - c e + \frac {{\left (c x + d\right )} e}{x}\right )} e^{\left (-1\right )}\right ) - b c d^{2} e \sin \left (-{\left (d f - c e\right )} e^{\left (-1\right )}\right ) \operatorname {Si}\left (-{\left (d f - c e + \frac {{\left (c x + d\right )} e}{x}\right )} e^{\left (-1\right )}\right ) + \frac {{\left (c x + d\right )} b d^{2} \cos \left (-{\left (d f - c e\right )} e^{\left (-1\right )}\right ) \operatorname {Ci}\left ({\left (d f - c e + \frac {{\left (c x + d\right )} e}{x}\right )} e^{\left (-1\right )}\right ) e}{x} + \frac {{\left (c x + d\right )} b d^{2} e \sin \left (-{\left (d f - c e\right )} e^{\left (-1\right )}\right ) \operatorname {Si}\left (-{\left (d f - c e + \frac {{\left (c x + d\right )} e}{x}\right )} e^{\left (-1\right )}\right )}{x} - b d^{2} e \sin \left (\frac {c x + d}{x}\right ) - a d^{2} e}{{\left (d f e^{2} - c e^{3} + \frac {{\left (c x + d\right )} e^{3}}{x}\right )} d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \frac {a+b\,\sin \left (c+\frac {d}{x}\right )}{{\left (e+f\,x\right )}^2} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________